from ps9pr1 import Board

class Player(object):
    def __init__(self,checker):
        '''

        '''
        assert(checker == 'O' or checker == 'X')
        self.checker = checker
        self.num_moves = 0

    def __repr__(self):
        '''

        '''
        return 'Player %s'%self.checker

    def opponent_checker(self):
        '''
        :return:
        '''
        if self.checker == 'X':
            return 'O'
        elif self.checker == 'O':
            return 'X'

    def next_move(self,board):
        '''
        :param board:
        :return:
        '''
        col_num = int(input('Enter a column:'))
        while not board.can_add_to(col_num):
            print('Try again!')
            col_num = int(input('Enter a column:'))
        self.num_moves += 1
        return col_num

if __name__ == '__main__':
    p = Player('X')
    b1 = Board(6, 7)
    p.next_move(b1)
    print(p.num_moves)